package com.mhkj.revise.monthPlan.repository;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.mhkj.revise.monthPlan.entity.Follow;
import com.mics.core.system.base.repository.BaseRepository;

public interface PlanMonthAddRepository  extends BaseRepository<Follow> {

	@Query("select t from Follow t where t.employeeId=:employeeId")
	List<Follow> getByEmployeeId(@Param("employeeId")String employeeId);

	@Query(value="select f.* from t_follow f left join t_plan_node p ON p.id = f.plan_node_id  where f.employee_id =:employeeId and p.id =:planNodeId ",nativeQuery=true)
	Follow getByUserAndPlanId(@Param("employeeId")String employeeId, @Param("planNodeId")long planNodeId);
	@Query(value="select f.* from t_follow f left join t_plan_node p ON p.id = f.plan_node_id  where 1=1 and p.id =:planNode and f.employee_id = :employeeId",nativeQuery=true)
    List<Follow> getByplanNodeId( @Param("planNode")long planNode, @Param("employeeId")String employeeId);
}
